// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   excel.java

package include.excel_export;

import java.sql.ResultSet;

public class excel
{

	private String dbase;
	private String tableName;
	private String timea;
	private String timeb;
	private String marketarea;
	private String sales;
	private String trade;
	private String fieldValue5;
	private String fieldName;
	private String fieldName1;
	private String fieldName2;
	private String fieldName3;
	private String fieldName4;
	private String fieldName5;
	private String realname;
	private String condition;
	private String queue;
	private String tagq;
	private String area1;
	private String area2;
	private String area3;
	private String sql;
	private String sql7;
	private ResultSet rs7;

	public excel()
	{
		dbase = "";
		tableName = "";
		timea = "";
		timeb = "";
		marketarea = "";
		sales = "";
		trade = "";
		fieldValue5 = "";
		fieldName = "";
		fieldName1 = "";
		fieldName2 = "";
		fieldName3 = "";
		fieldName4 = "";
		fieldName5 = "";
		realname = "";
		condition = "";
		queue = "";
		tagq = "";
		area1 = "";
		area2 = "";
		area3 = "";
		sql = "";
		sql7 = "";
		rs7 = null;
	}

	public String query(String dbase, String tName, String uTimea, String uTimeb, String uMarketarea, String uSales, String uTrade, 
			String uValue, String fName1, String fName2, String fName3, String fName4, String fName5, String uCondition, 
			String uQueue, String rName)
	{
		this.dbase = dbase;
		tableName = tName;
		timea = uTimea;
		timeb = uTimeb;
		marketarea = uMarketarea;
		sales = uSales;
		trade = uTrade;
		fieldValue5 = uValue;
		fieldName1 = fName1;
		fieldName2 = fName2;
		fieldName3 = fName3;
		fieldName4 = fName4;
		fieldName5 = fName5;
		condition = uCondition;
		queue = uQueue;
		realname = rName;
		try
		{
			if (!timeb.equals(""))
				timeb = (new StringBuilder(String.valueOf(timeb.substring(0, 10)))).append(" 23:59:59").toString();
			if (fieldValue5.equals(""))
			{
				if (timea.equals("") && timeb.equals("") && marketarea.equals("") && sales.equals("") && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && !timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName2).append("='").append(marketarea).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName4).append("='").append(sales).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && !timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && !timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && !timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && !timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && !timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && !timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && !timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && !timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && !timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && !timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && !timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && !timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && !timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && !timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (timea.equals("") && !timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
				else
				if (!timea.equals("") && timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(condition).append(" ").append(queue).toString();
				else
					sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(condition).append(" ").append(queue).toString();
			} else
			if (timea.equals("") && timeb.equals("") && marketarea.equals("") && sales.equals("") && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(condition).append("&&").append(fieldName5).append("='").append(fieldValue5).append("' ").append(queue).toString();
			else
			if (timea.equals("") && !timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && !timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && !timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && !timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && !timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && !timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && !timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && !timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && !timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && !timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && !timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && !timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && !timeb.equals("") && marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && !timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && !timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && timeb.equals("") && !marketarea.equals("") && (sales.equals("") || sales == null) && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (timea.equals("") && !timeb.equals("") && marketarea.equals("") && !sales.equals("") && sales != null && !trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append("<='").append(timeb).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
			if (!timea.equals("") && timeb.equals("") && !marketarea.equals("") && !sales.equals("") && sales != null && trade.equals(""))
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName2).append("='").append(marketarea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
			else
				sql = (new StringBuilder("select * from ")).append(tableName).append(" where ").append(fieldName1).append(">='").append(timea).append("' and ").append(fieldName4).append("='").append(sales).append("' and ").append(fieldName3).append("='").append(trade).append("' and ").append(fieldName5).append("='").append(fieldValue5).append("' and ").append(condition).append(" ").append(queue).toString();
		}
		catch (Exception exception) { }
		return sql;
	}
}
